<?php
class indexAction extends rareAction{
	public function execute(){}
	public function executePost(){
		$userName = $this->getPostParam('userName','');
		$password = md5($this->getPostParam('password',''));
		if($userName=='') redirect('login');
		$admin = new DaoAdmin();
		$user = $admin->getOne(" name='$userName' and password='$password'");
		if(empty($user)) redirect('login');
		Tool::_setSession('userID',$user['id']);
		Tool::_setSession('userName',$user['name']);
		Tool::_setSession('password',$user['password']);
		redirect('index');
	}
}
?>
